package com.lagou.subjectfive;

/**
 * 扑克牌
 */
public class PokerCard implements Comparable<PokerCard> {
    /**
     * 保存卡片大小 比较排序用
     */
    private int num;
    /**
     * 卡片花色
     */
    private CardColorEnum color;
    /**
     * 扑克牌的牌号
     */
    private String card;

    public PokerCard(int num, String card, CardColorEnum color) {
        this.num = num;
        this.color = color;
        this.card = card;
    }

    @Override
    public String toString() {
        return getCard() + getColor();
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getColor() {
        return color.getInfo();
    }

    public void setColor(CardColorEnum color) {
        this.color = color;
    }

    public String getCard() {
        return card;
    }

    public void setCard(String card) {
        this.card = card;
    }


    /**
     * 重写对比方法
     * @param o
     * @return
     */
    @Override
    public int compareTo(PokerCard o) {
        return this.getNum() - o.getNum();
    }
}
